import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const router = new Router({
    routes: [
        { path: '/', redirect: '/login' },
        { path: '/login', name: 'Login', component: resolve => require(['@/pages/Login/Login.vue'], resolve) },
        {
            path: '/index', name: 'Index', redirect: '/index/home', component: resolve => require(['@/pages/Index/Index.vue'], resolve),
            children: [
                {
                    path: '/index/home', name: 'Home', component: resolve => require(['@/pages/Index/Home.vue'], resolve)
                },
                {
                    path: '/index/dashboard', name: 'Dashboard', component: resolve => require(['@/pages/Index/Dashboard.vue'], resolve)
                },
                {
                    path: '/index/infoService', name: 'InfoService', component: resolve => require(['@/pages/Index/InfoService.vue'], resolve)
                },
                {
                    path: '/index/aboutUs', name: 'AboutUs', component: resolve => require(['@/pages/Index/AboutUs.vue'], resolve)
                },
            ]
        },
    ]
})

router.beforeEach((to, from, next) => {
    next()
    
})




export default router
